import http from '@/tool/http'
//得到商品列表的数据
export const getGoogs = (obj) => http.get('goods', { params: obj })
//商品分类数据 列表
export const categories = (obj) => http.get('categories', { params: obj })
//请求分类参数
export const cut = (id, sel) => http.get(`categories/${id}/attributes`, { params: sel })
//添加商品
export const addGoods = (obj) => http.post(`goods`, obj)
//删除商品
export const del = (id) => http.delete(`goods/${id}`)
//添加分类
export const addGoodsc = (obj) => http.post(`categories`, obj)
//编辑提交分类
export const editClassify = (id, obj) => http.put(`categories/${id}`, obj)
//删除分类
export const deleteClassify = (id) => http.delete(`categories/${id}`)
//编辑提交商品
export const edit = (id, obj) => http.put(`goods/${id}`, obj)
//添加参数
export const add = (id, obj) => http.post(`categories/${id}/attributes`, obj)
//添加动态参数或静态属性
export const editcanshu = (id, attrId, obj) => http.put(`categories/${id}/attributes/${attrId}`, obj)
//删除参数
export const dels = (id, attrid) => http.delete(`categories/${id}/attributes/${attrid}`)





